#! /bin/zsh

#
# Load profile
#
source /etc/zsh/zprofile

# Search path for the cd command
cdpath=(.. ~ / /etc)

# # Use hard limits, except for a smaller stack and no core dumps
# unlimit
# limit stack 8192
# limit core 0
# limit -s

#
# Load options
#
source /etc/zsh/options.zsh

# Autoload zsh modules when they are referenced
zmodload -a zsh/stat stat
zmodload -a zsh/zpty zpty
zmodload -a zsh/zprof zprof
zmodload -ap zsh/mapfile mapfile

#
# Load aliaces
#
source /etc/zsh/aliaces.zsh

#
# Load completion
#
source /etc/zsh/completion.zsh

#
# Load prompt
#
source /etc/zsh/prompt.zsh

# Shell functions
setenv() { typeset -x "${1}${1:+=}${(@)argv[2,$#]}" }  # csh compatibility
freload() { while (( $# )); do; unfunction $1; autoload -U $1; shift; done }

# Where to look for autoloaded function definitions
fpath=($fpath ~/.zsh/zfunc)

# Autoload all shell functions from all directories in $fpath (following
# symlinks) that have the executable bit on (the executable bit is not
# necessary, but gives you an easy way to stop the autoloading of a
# particular shell function). $fpath should not be empty for this to work.
for func in $^fpath/*(N-.x:t); autoload $func

# automatically remove duplicates from these arrays
typeset -U path cdpath fpath manpath

# # Hosts to use for completion (see later zstyle)
# hosts=(`hostname` ftp.math.gatech.edu prep.ai.mit.edu wuarchive.wustl.edu)

#
# Functions
#
source /etc/zsh/functions.zsh

#
# Load binds
#
source /etc/zsh/keybind.zsh
